package com.yunji.framework_template.books.biz.service;

import com.yunji.framework_template.books.orm.persistence.model.BooksChapters;
import com.yunji.framework_template.books.orm.persistence.mapper.BooksChaptersMapper;
import com.yunji.framework_template.common.web.Page;

import java.util.List;

import org.springframework.stereotype.Service;
import org.springframework.beans.factory.annotation.Autowired;

import org.apache.ibatis.annotations.Param;

/**
 *
 * Created by fenglibin on 2019/01/16.
 */
@Service
public class BooksChaptersService {

	@Autowired
    private BooksChaptersMapper booksChaptersMapper;
    
    public int deleteByPrimaryKey(Integer id){
        return booksChaptersMapper.deleteByPrimaryKey(id);
    }

    public int insert(BooksChapters record){
        return booksChaptersMapper.insert(record);
    }

    public int insertSelective(BooksChapters record){
        return booksChaptersMapper.insertSelective(record);
    }

    public BooksChapters selectByPrimaryKey(Integer id){
        return booksChaptersMapper.selectByPrimaryKey(id);
    }
    
    public BooksChapters selectByBookIdAndChapterIndex(int bookId,int chapterIndex){
        BooksChapters booksChapters = new BooksChapters();
        booksChapters.setBookId(bookId);
        booksChapters.setChapterIndex(chapterIndex);
        return booksChaptersMapper.selectByBookIdAndChapterIndex(booksChapters);
    }
    
    public List<BooksChapters> selectByBookId(Integer bookId){
        return booksChaptersMapper.selectByBookId(bookId);
    }

    public int updateByPrimaryKeySelective(BooksChapters record){
        return booksChaptersMapper.updateByPrimaryKeySelective(record);
    }

    public int updateByPrimaryKeyWithBLOBs(BooksChapters record){
        return booksChaptersMapper.updateByPrimaryKeyWithBLOBs(record);
    }

    public int updateByPrimaryKey(BooksChapters record){
        return booksChaptersMapper.updateByPrimaryKey(record);
    }
    
    public int updateReadTimesByPrimaryKey(BooksChapters record){
        return booksChaptersMapper.updateReadTimesByPrimaryKey(record);
    }
    
    public int updateLikeTimesByPrimaryKey(BooksChapters record){
        return booksChaptersMapper.updateLikeTimesByPrimaryKey(record);
    }
    
    public int updateCommentTimesByPrimaryKey(BooksChapters record){
        return booksChaptersMapper.updateCommentTimesByPrimaryKey(record);
    }

    public List<BooksChapters> selectByCondition(BooksChapters record){
        return booksChaptersMapper.selectByCondition(record);
    }

    public List<BooksChapters> selectAll(){
        return booksChaptersMapper.selectAll();
    }

    public List<BooksChapters> selectByPage(Page<BooksChapters> page){
        return booksChaptersMapper.selectByPage(page);
    }

    public Integer count(BooksChapters record){
        return booksChaptersMapper.count(record);
    }

    public int deleteByCondition(BooksChapters record){
        return booksChaptersMapper.deleteByCondition(record);
    }

}
